Fix return value problem for make-text-button
authorjustbur <justin@burkett.cc>
Mon, 30 Nov 2015 23:43:09 +0000 (18:43 -0500)
committerjustbur <justin@burkett.cc>
Mon, 30 Nov 2015 23:43:09 +0000 (18:43 -0500)
Apparently in versions before 24.5 the return value was not always the
button itself when a string was used as the argument

which-key.el

index 758fd00f5543a202d5f0f592be00eb0594f1d186..04bc4ef9a4663da6e24dc879a3fbac93930f3c6f 100644 (file)
@@ -1237,7 +1237,8 @@ ORIGINAL-DESCRIPTION is the description given by
                                  (max (floor (* (frame-width) 0.8))))
                             (if (> (length str) max)
                                 (concat (substring str 0 max) "...")
-                              str)))))))))
+                              str)))))))
+    desc))
 
 (defun which-key--format-and-replace (unformatted)
   "Take a list of (key . desc) cons cells in UNFORMATTED, add